<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>我的</title>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no,minimal-ui,viewport-fit=cover"/>
    <meta name="keywords" content="我的">
    <meta name="description" content="我的">
    <script type="text/javascript" src="js/base.js" charset="UTF-8"></script>
    <link rel="stylesheet" type="text/css" href="css/theme-chalk/index.css">
    <!-- <link rel="stylesheet" type="text/css" href="css/swiper-bundle.min.css"> -->
    <link rel="stylesheet" type="text/css" href="css/base.css">
    <link rel="stylesheet" type="text/css" href="css/style.css">
    <script type='text/javascript' src="js/jquery.min.js" charset="UTF-8"></script>
    <!-- <script type='text/javascript' src="js/html2canvas.min.js" charset="UTF-8"></script> -->
    <script type="text/javascript" src="js/layer/layer.js" charset="UTF-8"></script>
    <script type="text/javascript" src="js/vue.js" charset="UTF-8"></script>
    <script type="text/javascript" src="js/axios.min.js" charset="UTF-8"></script>
    <script type='text/javascript' src="js/elementui.min.js" charset="UTF-8"></script>
    <!-- <script type='text/javascript' src="js/swiper-bundle.min.js" charset="UTF-8"></script> -->
    <script type='text/javascript' src="../common/js/helper.js" charset="UTF-8"></script>
</head>
<body>
<div class="wrapperbox mypage hasmenu" id="app" v-if="loaded==true">
    <div class="my">
        <div class="user" v-if="isLogin==false" @click="gologin">
            <div class="fl">
                <div class="img"><img src="images/order-img.png" alt=""></div>
                <div class="text">
                    <div class="con">
                        <h3>点击登录</h3>
                    </div>
                </div>
            </div>
        </div>
        <div class="user" v-else>
            <div class="fl">
                <div class="img"><img :src="user_info.avatar_url" alt=""></div>
                <div class="text">
                    <div class="con">
                        <h3 style="padding-bottom: 0.1rem">{{user_info.nickname}}</h3>
                        <p v-if="user_info.mobile && user_info.mobile !== ''">{{user_info.mobile}}</p>
                        <p v-else><a style="color: #009fff" href="bind_mobile.html">绑定手机</a></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="list">
            <a href="./my-hzsq.html" class="item">商务合作<span class="icon"><i class="el-icon-arrow-right"></i></span></a>
            <a href="./my-about.html" class="item">关于抱团<span class="icon"><i class="el-icon-arrow-right"></i></span></a>
            <a href="./my-addwx.html" class="item">添加管理员微信<span class="icon"><i class="el-icon-arrow-right"></i></span></a>
        </div>
    </div>
    <div class="indexbotmenu">
        <a href="./index.html" class="item">
            <div class="img"><img src="images/index-botmenu-ico1.png" alt=""></div>
            <p>首页</p>
        </a>
        <a href="./order.html" class="item">
            <div class="img"><img src="images/index-botmenu-ico2.png" alt=""></div>
            <p>订单</p>
        </a>
        <a href="./my.html" class="item">
            <div class="img"><img src="images/index-botmenu-ico3-select.png" alt=""></div>
            <p>我的</p>
        </a>
    </div>
</div>
</body>
<script>
  new Vue({
    el: '#app',
    data() {
      return {
        serachtxt: '',
        isLogin: false,
        user_info: {},
        loaded: false,
      }
    },
    mounted() {
      
      var that = this;
      var user_info = JSON.parse(getCookie("user_info"));
      if (!user_info) {
        that.isLogin = false;
      } else {
        that.isLogin = true;
        that.user_info = user_info;
      }
      that.loaded = true;
    },
    methods: {
      gologin: function () {
        var sourceUrl = window.location.href;
        localStorage.setItem("login_source", JSON.stringify(sourceUrl));
        window.location.href = './login.html';
      },
      outLogin: function () {
        var that = this;
        var exp = new Date();
        exp.setTime(exp.getTime() - 1000);
        document.cookie = name + "access_token=;expires=" + exp.toGMTString() + ";path=/";
        document.cookie = name + "user_info=;expires=" + exp.toGMTString() + ";path=/";
        that.isLogin = false;
      },
    }
  });
</script>
</html>